package com.quantdo.qtm.mysql.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.quantdo.qtm.interfaces.common.QuantdoResponse;
import com.quantdo.qtm.interfaces.mysql.pojo.monitor.query.MysqlStatusPointQuery;
import com.quantdo.qtm.mysql.service.monitor.MysqlMonitorService;

@RestController
@RequestMapping("mysql")
public class MysqlMonitorController {

    @Autowired
    private MysqlMonitorService monitorService;

    @RequestMapping("selectstatus")
    @ResponseBody
    public Object selectStatus(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectStatus(mysqlStatusPointQuery);
    }

    @RequestMapping("selectqps")
    @ResponseBody
    public QuantdoResponse<?> selectQps(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectQps(mysqlStatusPointQuery);
    }

    @RequestMapping("selecttps")
    @ResponseBody
    public QuantdoResponse<?> selectTps(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectTps(mysqlStatusPointQuery);
    }

    @RequestMapping("selectdeleteqty")
    @ResponseBody
    public QuantdoResponse<?> selectDeleteqty(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectDeleteqty(mysqlStatusPointQuery);
    }

    @RequestMapping("selectinnodbbufferpool")
    @ResponseBody
    public QuantdoResponse<?> selectInnodbbufferpool(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectInnodbbufferpool(mysqlStatusPointQuery);
    }

    @RequestMapping("selectinsertqty")
    @ResponseBody
    public QuantdoResponse<?> selectInsertQty(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectInsertQty(mysqlStatusPointQuery);
    }

    @RequestMapping("selectmyisambufferpool")
    @ResponseBody
    public QuantdoResponse<?> selectMyisamBufferPool(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectMyisamBufferPool(mysqlStatusPointQuery);
    }

    @RequestMapping("selectreceivedflux")
    @ResponseBody
    public QuantdoResponse<?> selectReceivedFlux(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectReceivedFlux(mysqlStatusPointQuery);
    }

    @RequestMapping("selectselectqty")
    @ResponseBody
    public QuantdoResponse<?> selectSelectQty(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectSelectQty(mysqlStatusPointQuery);
    }

    @RequestMapping("selectsentflux")
    @ResponseBody
    public QuantdoResponse<?> selectSentFlux(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectSentFlux(mysqlStatusPointQuery);
    }

    @RequestMapping("selectslowqueries")
    @ResponseBody
    public QuantdoResponse<?> selectSlowQueries(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectSlowQueries(mysqlStatusPointQuery);
    }

    @RequestMapping("selectthreadconnedqty")
    @ResponseBody
    public QuantdoResponse<?> selectThreadConnedQty(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectThreadConnedQty(mysqlStatusPointQuery);
    }

    @RequestMapping("selectthreadconningqty")
    @ResponseBody
    public QuantdoResponse<?> selectThreadConningQty(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectThreadConningQty(mysqlStatusPointQuery);
    }

    @RequestMapping("selectupdateqty")
    @ResponseBody
    public QuantdoResponse<?> selectUpdateQty(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectUpdateQty(mysqlStatusPointQuery);
    }

    @RequestMapping("selectwriteqty")
    @ResponseBody
    public QuantdoResponse<?> selectWriteQty(MysqlStatusPointQuery mysqlStatusPointQuery) {
        return monitorService.selectWriteQty(mysqlStatusPointQuery);
    }

    // @RequestMapping("select")
    // @ResponseBody
    // public QuantdoResponse<?> select(MysqlStatusPointQuery mysqlStatusPointQuery) {
    // return monitorService.selectStatus(mysqlStatusPointQuery);
    // }
}
